package com.wangshouyu.mp.pay.v3.transactions;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @description 交易H5
 * @date 2020/8/14 9:42
 */
public class TransactionsH5Info implements Serializable {

    /**
     * 场景类型
     */
    @SerializedName(value = "type")
    @JsonProperty(value = "type")
    @JSONField(name = "type")
    private String type;

    /**
     * 应用名称
     */
    @SerializedName(value = "app_name")
    @JsonProperty(value = "app_name")
    @JSONField(name = "app_name")
    private String appName;

    /**
     * 网站URL
     */
    @SerializedName(value = "app_url")
    @JsonProperty(value = "app_url")
    @JSONField(name = "app_url")
    private String appUrl;

    /**
     * iOS平台BundleID
     */
    @SerializedName(value = "bundle_id")
    @JsonProperty(value = "bundle_id")
    @JSONField(name = "bundle_id")
    private String bundleId;

    /**
     * Android平台PackageName
     */
    @SerializedName(value = "package_name")
    @JsonProperty(value = "package_name")
    @JSONField(name = "package_name")
    private String packageName;

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getAppUrl() {
        return appUrl;
    }

    public void setAppUrl(String appUrl) {
        this.appUrl = appUrl;
    }

    public String getBundleId() {
        return bundleId;
    }

    public void setBundleId(String bundleId) {
        this.bundleId = bundleId;
    }

    public String getPackageName() {
        return packageName;
    }

    public void setPackageName(String packageName) {
        this.packageName = packageName;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TransactionsH5Info that = (TransactionsH5Info) o;
        return Objects.equals(type, that.type) &&
                Objects.equals(appName, that.appName) &&
                Objects.equals(appUrl, that.appUrl) &&
                Objects.equals(bundleId, that.bundleId) &&
                Objects.equals(packageName, that.packageName);
    }

    @Override
    public int hashCode() {
        return Objects.hash(type, appName, appUrl, bundleId, packageName);
    }

    @Override
    public String toString() {
        return "TransactionsH5Info{" +
                "type='" + type + '\'' +
                ", appName='" + appName + '\'' +
                ", appUrl='" + appUrl + '\'' +
                ", bundleId='" + bundleId + '\'' +
                ", packageName='" + packageName + '\'' +
                '}';
    }
}
